//统一管理咱们项目平台相关的接口
import request from "@/utils/request"
//项目用户相关的请求地址
const API = {
  PRODUCT_LIST_URL: "super/systemProduct/list",
  PRODUCT_STATUSCHANGE_URL: "super/systemProduct/statusChange",
  PRODUCT_ADD_URL: "super/systemProduct/add",
  PRODUCT_DETAIL_URL: "super/systemProduct/detail",
  PRODUCT_EDOT_URL: "super/systemProduct/edit",
  PRODUCT_DEL_URL: "super/systemProduct/del",
}

//获取商品列表
export const list = (params) =>
  request.get(API.PRODUCT_LIST_URL, { params })

//获取商品详情
export const detail = (params) =>
  request.get(API.PRODUCT_DETAIL_URL, { params })

//更改商品上下架状态
export const statusChange = (data) =>
  request.post(API.PRODUCT_STATUSCHANGE_URL, data)

//添加商品
export const create = (data) =>
  request.post(API.PRODUCT_ADD_URL, data)

//修改商品
export const update = (data) =>
  request.post(API.PRODUCT_EDOT_URL, data)

//删除商品
export const destroy = (data) =>
  request.post(API.PRODUCT_DEL_URL, data)